export class StringUtil {

  public static NO_PHONE = '请输入手机号';
  public static NO_NAME = '请输入姓名';
  public static NO_NICK = '请输入昵称';
  public static NO_INFO = '请输入完整信息';
  public static NO_SERVER = '服务器抽风,请刷新后重试';
  public static IMG_TOO_LARGE = '请上传2M以下图片';
  public static IMG_ERR_FORMAT = '请上传jpeg,jpg,png格式图片';
  public static CODE_SEND = '发送验证码';
  public static CODE_WAIT = '秒后发送';
  public static NO_URL = '暂无网址';
  public static NO_IMG = '未上传图片';
  public static NO_HTML = '暂无页面';

  public static isBlank(str): boolean {
    if (str == null || str === undefined || str === '' || str === '{}') {
      return true;
    } else {
      return false;
    }
  }

  public static getBase64(img: File, callback: (img: {}) => void): void {
    const reader = new FileReader();
    reader.addEventListener('load', () => callback(reader.result));
    reader.readAsDataURL(img);
  }


}
